<template>
	<view class="myCard" @click="gotoDetailFun">
		<view class="cardTopName">{{item && item.name ? item.name : '未知'}}</view>
		<view class="cardRow">
			<view>收入类型：</view>
			<view>{{item && item.type_name ? item.type_name : '未知'}}</view>
		</view>
		<view class="cardRow">
			<view>收入金额：</view>
			<view>{{item && item.money ? item.money : '0.00'}}</view>
		</view>
		<view class="cardRow">
			<view>收入日期：</view>
			<view>{{item && item.handle_date ? item.handle_date : '未知'}}</view>
		</view>
		<view class="cardRow">
			<view>经手人员：</view>
			<view>{{item && item.handle_user_name ? item.handle_user_name : '未知'}}</view>
		</view>
		<view v-if="!isDetail && !isSelect" class="lookDetail">
			<text>查看详情</text>
			<u-icon name="arrow-right" size="36"></u-icon>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default: () => {}
			},
			index: {
				type: Number,
				default: 0
			},
			isSelect: {
				type: Boolean,
				default: false
			},
			isDetail: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				
			}
		},
		methods: {
			gotoDetailFun: function() {
				if(this.isSelect) {
					return
				}
				uni.$incomeRecordInfo = this.item;
				uni.navigateTo({
					url: '/pages/crm/fin_income_record/detail?index=' + this.index
				})
			}
		}
	}
</script>

<style>
	.myCard {
		position: relative;
		background-color: #FFFFFF;
		margin: 20rpx;
		padding: 30rpx;
		border-radius: 20rpx;
		box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
	}

	.cardTopName {
		font-size: 32rpx;
		font-weight: bold;
		color: #333333;
		margin-bottom: 20rpx;
	}

	.cardRow {
		display: flex;
		font-size: 28rpx;
		color: #666666;
		margin-bottom: 12rpx;
		line-height: 1.5;
	}

	.cardRow > view:first-child {
		width: 200rpx;
		color: #999999;
	}

	.cardRow > view:last-child {
		flex: 1;
		color: #333333;
	}

	.lookDetail {
		margin-top: 20rpx;
		padding-top: 20rpx;
		border-top: 1rpx solid #EEEEEE;
		display: flex;
		justify-content: space-between;
		align-items: center;
		color: #007AFF;
		font-size: 28rpx;
	}
</style>